using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using DevMaker.SIC.Model.BaseObject;
using log4net;


namespace DevMaker.SIC.Model {
    public class Reposicion : IdentifiableObject {
        private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public Usuario Supervisor { set; get; }
        public List<ReposicionDetalle> Detalle { set; get; }
        public Boolean EsInicio { set; get; }
        public DateTime Fecha { set; get; }
        public Reposicion() {
            Detalle = new List<ReposicionDetalle>();
        }

        public void ReadFromDataReader(SqlDataReader reader) {
            try {
                Id = Convert.ToInt32(reader["reposicion_id"]);
                Fecha = Convert.ToDateTime(reader["reposicion_fecha"]);
                Supervisor = new Usuario();
                Supervisor.ReaderSupervisorFromDataReader(reader);
            } catch (Exception ex) {
                Log.Error(ex);
            }
        }
    }
}